package com.scs.application.modules.dept.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.scs.application.core.query.QueryContext;
import com.scs.application.core.service.IBaseService;
import com.scs.application.modules.dept.entity.OprtUse;
import com.scs.application.modules.sys.model.RestResult;
import com.scs.application.modules.thirdparty.dto.HisOprtUse;
import com.scs.application.modules.thirdparty.dto.HisOprtUseBatch;
import com.scs.application.modules.thirdparty.dto.his.HisHighBillBatch;
import com.scs.application.modules.thirdparty.dto.his.HisHighLock;
import com.scs.application.modules.thirdparty.dto.his.HisHighUnlock;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Service
 * </p>
 */

public interface OprtUseService extends IBaseService<OprtUse> {

    /**
     *  his 病人计费
     * @param hisOprtUse
     * @return
     */
    List<OprtUse> hisSaveOprtUse(HisOprtUse hisOprtUse);

    @Transactional(rollbackFor = Exception.class)
    /**
     * @Description： HIS计费或者退费
     */
    void hisSaveOprtUseBatch(List<HisOprtUseBatch> hisOprtUseBatch);

    /**
     * 补全病人信息
     *
     * @param
     * @return
     */
    void docInfoSave();
    /**
     * 修改对应科室信息
     *
     * @param
     * @return
     */
    OprtUse updateInfo(String busKey);

    RestResult toRedById(String oprtUseId);

    /**
     * 同步病人消耗单至供应商平台
     * @param idList
     * @return
     */
    String syncToMSCM();

    /**
     * 科室审核数据更新
     * @param idList
     * @return
     */
    void auditDeptOprtUse(List<String> idList);

    IPage pageForSelect(QueryContext queryContext, Map<String, Object> userParam);

    RestResult substituteOprtUse();

    // 仅加锁
    void lockBatchOnly(HisHighLock param,boolean isReturn);

    void unlockBatchOnly(HisHighUnlock param, boolean isReturn);

    @Transactional(rollbackFor = Exception.class)
    void hisSaveOprtUseBatchV2(HisHighBillBatch param, boolean isReturn, boolean isUnlockQueryHis);
}
